package bento.views.pnls;

import java.awt.Component;

import javax.swing.JPanel;

import bento.IHasWrapper;
import bento.IWrapper;
import bento.api.IQuerier;
import bento.types.IStore;
import bento.views.pnls.CopyOfPnlStores.Wrapper;

import javax.swing.JTabbedPane;

import java.awt.BorderLayout;
import com.jgoodies.forms.layout.FormLayout;
import com.jgoodies.forms.layout.ColumnSpec;
import com.jgoodies.forms.layout.RowSpec;
import com.jgoodies.forms.factories.FormFactory;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JSplitPane;
import javax.swing.border.TitledBorder;
import javax.swing.JScrollPane;
import javax.swing.Box;
import java.awt.GridLayout;
import javax.swing.JCheckBox;
import javax.swing.border.EtchedBorder;
import javax.swing.JRadioButton;
import javax.swing.UIManager;
import javax.swing.JTextField;
import javax.swing.JLabel;
import javax.swing.JTextPane;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;


public class CopyOfPnlStores extends JPanel implements IHasWrapper<CopyOfPnlStores.Wrapper> {
    private Wrapper wrapper;
    private JTextField textField;
    private JTextField textField_1;
    private JTextField textField_2;
    private JTextField textField_3;
    private JTable table;
    private JTable table_1;
    
    
    @Override
    public Wrapper getWrapper() {
        return wrapper;
    }

    /**
     * Create the panel.
     */
    public CopyOfPnlStores() {
        setLayout(new BorderLayout(0, 0));
        
        JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
        add(tabbedPane);
        
        JPanel panel = new JPanel();
        tabbedPane.addTab("SplitMode", null, panel, null);
        panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
        
        JSplitPane splitPane = new JSplitPane();
        splitPane.setResizeWeight(0.3);
        panel.add(splitPane);
        
        JPanel panel_3 = new JPanel();
        splitPane.setLeftComponent(panel_3);
        panel_3.setLayout(new BorderLayout(0, 0));
        
        JPanel panel_5 = new JPanel();
        panel_3.add(panel_5, BorderLayout.CENTER);
        panel_5.setLayout(new FormLayout(new ColumnSpec[] {
                ColumnSpec.decode("default:grow"),},
            new RowSpec[] {
                FormFactory.DEFAULT_ROWSPEC,
                RowSpec.decode("default:grow"),}));
        
        JPanel panel_8 = new JPanel();
        panel_8.setBorder(new TitledBorder(null, "Fiters", TitledBorder.LEADING, TitledBorder.TOP, null, null));
        panel_5.add(panel_8, "1, 1, center, center");
        panel_8.setLayout(new FormLayout(new ColumnSpec[] {
                FormFactory.DEFAULT_COLSPEC,
                ColumnSpec.decode("default:grow"),},
            new RowSpec[] {
                FormFactory.DEFAULT_ROWSPEC,
                FormFactory.DEFAULT_ROWSPEC,}));
        
        JCheckBox chckbxName = new JCheckBox("Name");
        panel_8.add(chckbxName, "1, 1");
        
        textField = new JTextField();
        panel_8.add(textField, "2, 1, fill, default");
        textField.setColumns(10);
        
        JCheckBox chckbxTel = new JCheckBox("Tel");
        panel_8.add(chckbxTel, "1, 2");
        
        textField_1 = new JTextField();
        panel_8.add(textField_1, "2, 2, fill, default");
        textField_1.setColumns(10);
        
        JPanel panel_7 = new JPanel();
        panel_7.setBorder(new TitledBorder(null, "Stores", TitledBorder.LEADING, TitledBorder.TOP, null, null));
        panel_5.add(panel_7, "1, 2, fill, fill");
        panel_7.setLayout(new BorderLayout(0, 0));
        
        JScrollPane scrollPane = new JScrollPane();
        panel_7.add(scrollPane, BorderLayout.CENTER);
        
        table_1 = new JTable();
        table_1.setModel(new DefaultTableModel(
            new Object[][] {
                {null, null, null},
                {null, null, null},
                {null, null, null},
            },
            new String[] {
                "New column", "New column", "New column"
            }
        ));
        scrollPane.setViewportView(table_1);
        
        JPanel panel_4 = new JPanel();
        panel_4.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "Store", TitledBorder.LEADING, TitledBorder.TOP, null, null));
        splitPane.setRightComponent(panel_4);
        panel_4.setLayout(new BorderLayout(0, 0));
        
        JPanel panel_6 = new JPanel();
        panel_4.add(panel_6, BorderLayout.CENTER);
        panel_6.setLayout(new BorderLayout(0, 0));
        
        JPanel panel_11 = new JPanel();
        panel_6.add(panel_11, BorderLayout.NORTH);
        panel_11.setLayout(new FormLayout(new ColumnSpec[] {
                ColumnSpec.decode("right:default"),
                ColumnSpec.decode("default:grow"),},
            new RowSpec[] {
                FormFactory.DEFAULT_ROWSPEC,
                FormFactory.DEFAULT_ROWSPEC,
                RowSpec.decode("default:grow"),}));
        
        JLabel lblName = new JLabel("Name: ");
        panel_11.add(lblName, "1, 1, right, default");
        
        textField_2 = new JTextField();
        panel_11.add(textField_2, "2, 1, fill, default");
        textField_2.setColumns(10);
        
        JLabel lblTel = new JLabel("Tel: ");
        panel_11.add(lblTel, "1, 2, right, default");
        
        textField_3 = new JTextField();
        textField_3.setColumns(10);
        panel_11.add(textField_3, "2, 2, fill, default");
        
        JLabel lblDesc = new JLabel("Desc: ");
        panel_11.add(lblDesc, "1, 3");
        
        JTextPane textPane = new JTextPane();
        textPane.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null));
        panel_11.add(textPane, "2, 3, fill, fill");
        
        JPanel panel_12 = new JPanel();
        panel_12.setBorder(new TitledBorder(null, "Bentos", TitledBorder.LEADING, TitledBorder.TOP, null, null));
        panel_6.add(panel_12);
        panel_12.setLayout(new BorderLayout(0, 0));
        
        JScrollPane scrollPane_1 = new JScrollPane();
        panel_12.add(scrollPane_1, BorderLayout.CENTER);
        
        table = new JTable();
        table.setModel(new DefaultTableModel(
            new Object[][] {
            },
            new String[] {
                "New column", "New column", "New column"
            }
        ));
        scrollPane_1.setViewportView(table);
        
        JPanel panel_1 = new JPanel();
        tabbedPane.addTab("ListMode", null, panel_1, null);
        tabbedPane.setEnabledAt(1, false);
        
        JPanel panel_2 = new JPanel();
        tabbedPane.addTab("TableMode", null, panel_2, null);
        tabbedPane.setEnabledAt(2, false);

    }

    public class Wrapper implements IWrapper<Component> {

        @Override
        public Component get() {
            return CopyOfPnlStores.this;
        }
        
        public Wrapper(bento.api.IBentoClient bentoClient) {
            CopyOfPnlStores.this.wrapper= this;
        }
    }
}
